#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <cmath>
#include <time.h>
using namespace std;

struct event
{
    int a;
    int b;

    ~event() { cout << "~event" << endl; }
};

int main(int argc, char *argv[])
{
    event *ee = (event *)operator new(sizeof(event));
    delete ee;
    
    char *a = new char(8);
    a[0]=1,a[1]=2,a[2]=3,a[3]=4,a[4]=5,a[5]=6,a[6]=7,a[7]=8;
    event *e = new(a) event;
    printf("0x%.8x, 0x%.8x\n", e->a, e->b);

    e->a = 1;
    e->b = 2;
    printf("%d,%d,%d,%d,%d,%d,%d,%d\n", a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);
    
    delete e;
    printf("%d,%d,%d,%d,%d,%d,%d,%d\n", a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);
    //event *e1 = (event *)operator new(8, &a);
    //printf("0x%.8x, 0x%.8x\n", e1->a, e1->b);

	return 0;
}

